var express = require('express');
var router = express.Router();
var Comment = require('../models/comment.js');
var check = require('./check');
var checkLogin = check['checkLogin'];
var checkNotLogin = check['checkNotLogin'];

router.post('/',checkLogin);
router.post('/',function(req,res,next){
  var _id = req.body['_id'];
  Comment.delete(_id,function(err){
    if(err){
      console.log(err);
      res.json({success:false});
    }else{
      res.json({success:true});
    }
  })
});

module.exports = router;